﻿#include "Engine.h"
#include "cGame_Load.h"
#include "Skydome.h"
#include "Camera.h"
#include "Scene.h"
#include "ObjectTemplate.h"
#include "TouchCore.h"
#include "SpritesInclude.h"

extern cGame_Load *cgame_Load;
extern Camera camera;
extern char s_spritePackList[SPRITE_LIST::SPRITE_MAX][50];
extern char s_fontPackList[FONT_LIST::FONT_MAX][50];
extern int fontMapping_FONT_MEDIUM[256];

Skydome *skydome;
Scene *scene;
ObjectTemplate *objTemp;
extern Sprite * s_sprite[SPRITE_LIST::SPRITE_MAX];
extern Sprite * s_font[FONT_LIST::FONT_MAX];

bool isTouchButton = false;
extern int s_frameCount;

int intX = 100;

LogoState::LogoState():GameState()
{	
	
}

LogoState::~LogoState()
{
}

void LogoState::Init()
{	
	LOGE("\nInit of Logo State\n");	

	s_sprite[SPRITE_LIST::SPRITE_MENU] = DataCore::GetData()->LoadSprite(s_spritePackList[SPRITE_LIST::SPRITE_MENU]);
	s_sprite[SPRITE_LIST::SPRITE_MENU_DEFAULT] = DataCore::GetData()->LoadSprite(s_spritePackList[SPRITE_LIST::SPRITE_MENU_DEFAULT]);
	s_font[FONT_LIST::FONT_MEDIUM] = DataCore::GetData()->LoadSprite(s_fontPackList[FONT_LIST::FONT_MEDIUM]);
	s_font[FONT_LIST::FONT_MEDIUM]->SetFontMapping (fontMapping_FONT_MEDIUM);
	DataCore::GetData()->LoadGui ( "gui.pack" );
	SceneEngine::GetSceneEngine()->OpenScene ( GUI_LAYER::NEW_GUI );


	TouchCore::GetTouch()->MenuAddOption(0, 0, 400, 240);
	TouchCore::GetTouch()->MenuAddOption(400, 240, 402, 242);
	TouchCore::s_MenuSelection = -1;
}

void LogoState::Update()
{	

	if (TouchCore::GetTouch()->IsTouchReleased())
	{
		switch(TouchCore::s_MenuSelectionReleased)
		{
			case 0:
				LOGE("\nAAAAAAAAAAAAAAAAAAAA");
				break;
			case 1:
				LOGE("\nBBBBBBBBBBBBBBBBBBBB");
				break;
		}
	}

	
}

void LogoState::Render()
{		
	
	
	SceneEngine::GetSceneEngine()->PaintScene ( GUI_LAYER::NEW_GUI, 0, 0 );	
}

void LogoState::Destroy()
{
	LOGE("\nDestroy of Logo State\n");
}